﻿#ifndef MAPMODEL_H
#define MAPMODEL_H

#include <QtCore/QObject>
#include <QtCore/qglobal.h>
#include <QGeoCoordinate>

class TrajectoryPoints;
class MapModel : public QObject
{
    Q_OBJECT

public:
    MapModel(QObject *parent = nullptr);
    ~MapModel();

    Q_PROPERTY(TrajectoryPoints* trajectoryPoints   MEMBER _trajectoryPoints    CONSTANT)

    void updateFlightDistance(double distance);

public slots:
    void coordinateReceived(QGeoCoordinate coordinate);

signals:
    void homeCoordinateChanged(QGeoCoordinate coordinate);
    void coordinateChanged(QGeoCoordinate coordinate);
    void clearTrajectory();

private:
    TrajectoryPoints* _trajectoryPoints = nullptr;
    double _distance = .0;
};

#endif // MAPMODEL_H
